#ifndef ROOM_CACHE_COMMAND_IN_H_
#define ROOM_CACHE_COMMAND_IN_H_
#include "command.h"

#pragma pack(1)
namespace Cmd
{
        namespace RoomCache
        {
                //  cmd declaration
                enum {
                        CMDIN_LOGIN             = 0x0016,       // 登录RoomRecordServer验证指令
                        CMDIN_ROOM              = 0x0017,	// 与RoomServer交互的指令
                };
                enum { //CMDIN_LOGIN
                        SCMDIN_LOGIN                            = 0x0001,       // 请求登录RoomRecordServer
                        SCMDIN_LOGIN_RESPONCE                   = 0x0002,	// 登录RoomRecordServer返回
                };
                enum { //CMDIN_ROOM
                        SCMDIN_R_REQ_SYNC_ROOMS                 = 0x0001,       // roomcacheserver启动时请求同步roomserver上的信息
                        SCMDIN_R_SYNC_MIC_LIST                  = 0x0003,       // room->roomcache:同步麦序列表
                        SCMDIN_R_SYNC_HAND_LIST                 = 0x0004,       // room->roomcache:同步举手列表
                        SCMDIN_R_ADD_ROOM_old                   = 0x0005,       // room->roomcache:同步房间信息
                        SCMDIN_R_DEL_ROOM                       = 0x0006,
                        SCMDIN_R_RES_ROOM_old                   = 0x0008,       // 将频道信息返回给roomserver
                        SCMDIN_R_RES_ROOM_END                   = 0x0009,
                        SCMDIN_R_DEL_USER                       = 0x000B,
                        SCMDIN_R_CHANGE_MODE                    = 0x000D,
                        SCMDIN_R_ADD_MIC                        = 0x000E,
                        SCMDIN_R_DEL_MIC                        = 0x000F,
                        SCMDIN_R_CHANGE_MIC_TIME                = 0x0010,
                        SCMDIN_R_CHANGE_MIC_USER_TIME           = 0x0011,
                        SCMDIN_R_RES_MIC_LIST                   = 0x0012,       // 返回麦序列表
                        SCMDIN_R_ADD_HAND                       = 0x0013,
                        SCMDIN_R_DEL_HAND                       = 0x0014,
                        SCMDIN_R_RES_HAND_LIST                  = 0x0015,       // 返回举手列表
                        SCMDIN_R_SYNC_CONTROL_STAT              = 0x0016,
                        SCMDIN_R_SYNC_SHOWIDENTITY              = 0x0017,
                        SCMDIN_R_SYNC_FIDELITY                  = 0x0018,
                        SCMDIN_R_DEL_WHITEBOARD                 = 0x001A,
                        SCMDIN_R_SYNC_VIDEOINFO                 = 0x001C,
                        SCMDIN_R_DEL_VIDEOINFO                  = 0x001D,
                        SCMDIN_R_RES_VIDEOINFO                  = 0x001E,
                        SCMDIN_R_SYNC_WHITEBOARD                = 0x001F,
                        SCMDIN_R_RES_WHITEBOARD                 = 0x0020,
                        SCMDIN_R_SYNC_ANSWERCARD                = 0x0021,
                        SCMDIN_R_DEL_ANSWERCARD                 = 0x0022,
                        SCMDIN_R_RES_ANSWERCARD                 = 0x0023,
                        SCMDIN_R_SYNC_WB_ELEMENT                = 0x0024,
                        SCMDIN_R_DEL_WB_ELEMENT                 = 0x0025,
                        SCMDIN_R_RES_WB_ELEMENT                 = 0x0026,
                        SCMDIN_R_SYNC_CLASS_INFO_old            = 0x0027,
                        SCMDIN_R_SYNC_QUESTION_LIST             = 0x0028,
                        SCMDIN_R_SYNC_QUESTION_LIKE_LIST        = 0x0029,
                        SCMDIN_R_ADD_QUESTION                   = 0x002A,
                        SCMDIN_R_DEL_QUESTION                   = 0x002B,
                        SCMDIN_R_CLEAR_QUESTION                 = 0x002C,
                        SCMDIN_R_SYNC_QUESTION_LIKE             = 0x002D,
                        SCMDIN_R_SYNC_QUESTION_MODIFY           = 0x002E,
                        SCMDIN_R_ADD_USER                       = 0x0033,
                        SCMDIN_R_SYNC_USER_LIST                 = 0x0034,
                        SCMDIN_R_REQ_ROOM_old                   = 0x0035,
                        SCMDIN_R_RES_USER_LIST                  = 0x0036,
                        SCMDIN_R_SYNC_ROOM_BASE_INFO            = 0x0037,
                        SCMDIN_R_ROOM_BASE_INFO_REQ             = 0x0038,
                        SCMDIN_R_ROOM_BASE_INFO_RET             = 0x0039,
                        SCMDIN_R_ROOM_CLASS_INFO_REQ_old        = 0x003A,
                        SCMDIN_R_ROOM_CLASS_INFO_RET_old        = 0x003B,
                        SCMDIN_R_ROOM_RESTORE_REQ               = 0x003C,
                        SCMDIN_R_ROOM_RESTORE_RET               = 0x003D,
                        SCMDIN_R_SYNC_DALABA                    = 0x003E,
                        SCMDIN_R_DALABA_REQ                     = 0x003F,
                        SCMDIN_R_DALABA_RET                     = 0x0040,
                        SCMDIN_R_ADD_USER_NEW                = 0x0041,
                        SCMDIN_R_RES_USER_LIST_NEW          = 0x0042,
                        SCMDIN_R_SYNC_USER_LIST_NEW        = 0x0043,
                        SCMDIN_R_SYNC_COURSE_INFO               = 0x0044,
                        SCMDIN_R_COURSE_INFO_REQ                = 0x0045,
                        SCMDIN_R_COURSE_INFO_RET                = 0x0046,
                };

                //	cmd definition
                struct stLoginCmd:t_NullCmd
                {
                        stLoginCmd():
                                t_NullCmd(CMDIN_LOGIN, SCMDIN_LOGIN)
                        {
                                dest_type_ = ROOMCACHESERVER;
                                server_type_ = 0;
                                server_id_ = 0;
                        }
                        WORD dest_type_;
                        WORD server_type_;
                        DWORD server_id_;
                };
                struct stLoginResponce:t_NullCmd
                {
                        stLoginResponce():
                                t_NullCmd(CMDIN_LOGIN, SCMDIN_LOGIN_RESPONCE)
                        {
                        }
                };

                struct stRReqSyncRooms:
                        t_NullCmd
                {
                        stRReqSyncRooms():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_R_REQ_SYNC_ROOMS)
                        {
                        }
                };
                struct stRSyncMicList:
                        t_NullCmd
                {
                        stRSyncMicList():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_R_SYNC_MIC_LIST)
                        {
                                room_id_ = 0;
                                num_ = 0;
                                ismanager_ = 0;
                        }
                        DWORD room_id_;
                        WORD num_;
                        BYTE ismanager_; //0-no 1-yes
                        struct {
                                DWORD userid;
                                DWORD addtime;
                        } list_[0];
                        DWORD getSize() {
                                return sizeof(*this)+num_*sizeof(list_[0]);
                        }
                };
                struct stRSyncHandList:
                        t_NullCmd
                {
                        stRSyncHandList():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_R_SYNC_HAND_LIST)
                        {
                                room_id_ = 0;
                                num_ = 0;
                        }
                        DWORD room_id_;
                        WORD num_;
                        DWORD list_[0];
                        DWORD getSize() {
                                return sizeof(*this)+num_*sizeof(list_[0]);
                        }
                };
                struct stRAddRoom_old:
                        t_NullCmd
                {
                        stRAddRoom_old():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_R_ADD_ROOM_old)
                        {
                                room_id_ = 0;
                                mode_ = eRoomMode_Dialog;
                                control_status_ = 0;
                                app_bit_mask_ = 0;      // 不使用
                                mic_time_ = 600;
                                fidelity_ = 0;
                        }
                        DWORD room_id_;
                        BYTE mode_;
                        DWORD control_status_;
                        DWORD app_bit_mask_;    // 不使用
                        DWORD mic_time_;
                        BYTE fidelity_;
                };
                struct stRDelRoom:
                        t_NullCmd
                {
                        stRDelRoom():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_R_DEL_ROOM)
                        {
                                room_id_ = 0;
                        }
                        DWORD room_id_;
                };
                struct stRResRoom_old:
                        t_NullCmd
                {
                        stRResRoom_old():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_R_RES_ROOM_old)
                        {
                                room_id_ = 0;
                                mode_ = eRoomMode_Dialog;
                                control_status_ = 0;
                                app_bit_mask_ = 0;      // 不使用
                                mic_time_ = 600;
                                fidelity_ = 0;
                                class_teacher_id_ = 0;
                                bzero(class_teacher_account_, sizeof(class_teacher_account_));
                                bzero(class_teacher_nickname_, sizeof(class_teacher_nickname_));
                                class_start_time_ = 0;
                        }
                        uint32_t room_id_;
                        uint8_t  mode_;
                        uint32_t control_status_;
                        uint32_t app_bit_mask_;    // 不使用
                        uint32_t mic_time_;
                        uint8_t  fidelity_;
                        uint32_t class_teacher_id_;     //上课老师
                        char class_teacher_account_[MAX_ACCOUNT_SIZE+1];
                        char class_teacher_nickname_[MAX_NAME_SIZE+1];
                        uint32_t class_start_time_;     //上课开始时间
                };
                struct stRResRoomEnd:
                        t_NullCmd
                {
                        stRResRoomEnd():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_R_RES_ROOM_END)
                        {
                                room_id_ = 0;
                        }
                        DWORD room_id_;
                };
                struct stRDelUser:
                        t_NullCmd
                {
                        stRDelUser():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_R_DEL_USER)
                        {
                                room_id_ = 0;
                                user_id_ = 0;
                        }
                        DWORD room_id_;
                        DWORD user_id_;
                };
                struct stRChangeMode:
                        t_NullCmd
                {
                        stRChangeMode():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_R_CHANGE_MODE)
                        {
                                room_id_ = 0;
                                room_mode_ = eRoomMode_Dialog;
                        }
                        DWORD room_id_;
                        BYTE room_mode_;
                };
                struct stRAddMic:
                        t_NullCmd
                {
                        stRAddMic():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_R_ADD_MIC)
                        {
                                room_id_ = 0;
                                user_id_ = 0;
                                add_time_ = 0;
                                is_manager_ = 0;
                        }
                        DWORD room_id_;
                        DWORD user_id_;
                        DWORD add_time_;
                        BYTE is_manager_;//0-no 1-yes
                };
                struct stRDelMic:
                        t_NullCmd
                {
                        stRDelMic():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_R_DEL_MIC)
                        {
                                room_id_ = 0;
                                user_id_ = 0;
                                is_manager_ = 0;
                        }
                        DWORD room_id_;
                        DWORD user_id_;
                        BYTE is_manager_;//0-no, 1-yes
                };
                struct stRChangeMicTime:
                        t_NullCmd
                {
                        stRChangeMicTime():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_R_CHANGE_MIC_TIME)
                        {
                                room_id_ = 0;
                                mic_time_ = 600;
                        }
                        DWORD room_id_;
                        DWORD mic_time_;
                };
                struct stRChangeMicUserTime:
                        t_NullCmd
                {
                        stRChangeMicUserTime():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_R_CHANGE_MIC_USER_TIME)
                        {
                                room_id_ = 0;
                                user_id_ = 0;
                                add_time_ = 0;
                                is_manager_ = 0;
                        }
                        DWORD room_id_;
                        DWORD user_id_;
                        DWORD add_time_;
                        BYTE is_manager_; //0-no 1-yes
                };
                struct stRResMicList:
                        t_NullCmd
                {
                        stRResMicList():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_R_RES_MIC_LIST)
                        {
                                room_id_ = 0;
                                num_ = 0;
                        }
                        DWORD room_id_;
                        WORD  num_;
                        struct {
                                DWORD userid;
                                DWORD addtime;
                        } list_[0];
                        DWORD getSize() {
                                return sizeof(*this)+num_*sizeof(list_[0]);
                        }
                };
                struct stRAddHand:
                        t_NullCmd
                {
                        stRAddHand():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_R_ADD_HAND)
                        {
                                room_id_ = 0;
                                user_id_ = 0;
                        }
                        DWORD room_id_;
                        DWORD user_id_;
                };
                struct stRDelHand:
                        t_NullCmd
                {
                        stRDelHand():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_R_DEL_HAND)
                        {
                                room_id_ = 0;
                                user_id_ = 0;
                        }
                        DWORD room_id_;
                        DWORD user_id_;
                };
                struct stRResHandList:
                        t_NullCmd
                {
                        stRResHandList():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_R_RES_HAND_LIST)
                        {
                                room_id_ = 0;
                                num_ = 0;
                        }
                        DWORD room_id_;
                        WORD num_;
                        DWORD list_[0];
                        DWORD getSize() {
                                return sizeof(*this)+num_*sizeof(list_[0]);
                        }
                };
                struct stRSyncControlStatus:
                        t_NullCmd
                {
                        stRSyncControlStatus():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_R_SYNC_CONTROL_STAT)
                        {
                                room_id_ = 0;
                                control_status_ = 0;
                        }
                        DWORD room_id_;
                        DWORD control_status_;  //按位表示,每位属性参考eRoomControlStatusType
                };
                struct stRSyncShowIdentity:
                        t_NullCmd
                {
                        stRSyncShowIdentity():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_R_SYNC_SHOWIDENTITY)
                        {
                                room_id_ = 0;
                                user_id_ = 0;
                                show_identity_ = eRoomAuthority_Invalid;
                        }
                        DWORD room_id_;
                        DWORD user_id_;
                        BYTE show_identity_;
                };
                struct stRSyncFidelity:
                        t_NullCmd
                {
                        stRSyncFidelity():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_R_SYNC_FIDELITY)
                        {
                                room_id_ = 0;
                                fidelity_ = 0;
                        }
                        DWORD room_id_;
                        BYTE fidelity_;
                };
                struct stRSyncWhiteBoard:
                        t_NullCmd
                {
                        stRSyncWhiteBoard():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_R_SYNC_WHITEBOARD)
                        {
                                room_id_ = 0;
                                user_id_ = 0;
                                current_version_ = 0;
                                current_page_ = 0;
                                link_len_ = 0;
                        }

                        DWORD getSize() const
                        {
                                return sizeof(*this)+link_len_*sizeof(link_[0]);
                        }

                        DWORD room_id_;
                        DWORD user_id_;
                        DWORD current_version_;
                        WORD current_page_;
                        DWORD link_len_;
                        char link_[0];
                };
                struct stRDelWhiteBoard:
                        t_NullCmd
                {
                        stRDelWhiteBoard():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_R_DEL_WHITEBOARD)
                        {
                                room_id_ = 0;
                        }
                        DWORD room_id_;
                };
                struct stRResWhiteBoard:
                        t_NullCmd
                {
                        stRResWhiteBoard():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_R_RES_WHITEBOARD)
                        {
                                room_id_ = 0;
                                user_id_ = 0;
                                current_version_ = 0;
                                current_page_ = 0;
                                link_len_ = 0;
                        }

                        DWORD getSize() const
                        {
                                return sizeof(*this)+link_len_*sizeof(link_[0]);
                        }

                        DWORD room_id_;
                        DWORD user_id_;
                        DWORD current_version_;
                        WORD current_page_;
                        DWORD link_len_;
                        char link_[0];
                };
                struct stRSyncVideoInfo:
                        t_NullCmd
                {
                        stRSyncVideoInfo():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_R_SYNC_VIDEOINFO)
                        {
                                room_id_ = 0;
                                size_ = 0;
                        }

                        DWORD getSize() const
                        {
                                return sizeof(*this) + size_*sizeof(json_[0]);
                        }

                        DWORD room_id_;
                        WORD size_;
                        char json_[0];
                        // json_ = video_user_info(value) + desktop_user_info(value)
                        // video_user_info = video_users(value)
                        // video_users = video_user(value)...
                        // video_user = user_id(uint)
                        // desktop_user_info = desktop_users(value)
                        // desktop_users = desktop_user(value)...
                        // desktop_user = user_id(uint)
                };
                struct stRDelVideoInfo:
                        t_NullCmd
                {
                        stRDelVideoInfo():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_R_DEL_VIDEOINFO)
                        {
                                room_id_ = 0;
                        }

                        DWORD room_id_;
                };
                struct stRResVideoInfo:
                        t_NullCmd
                {
                        stRResVideoInfo():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_R_RES_VIDEOINFO)
                        {
                                room_id_ = 0;
                                size_ = 0;
                        }

                        DWORD getSize() const
                        {
                                return sizeof(*this) + size_*sizeof(json_[0]);
                        }

                        DWORD room_id_;
                        WORD size_;
                        char json_[0];
                        // json_ = video_user_info(value) + desktop_user_info(value)
                        // video_user_info = video_users(value)
                        // video_users = video_user(value)...
                        // video_user = user_id(uint)
                        // desktop_user_info = desktop_users(value)
                        // desktop_users = desktop_user(value)...
                        // desktop_user = user_id(uint)
                };
                struct stRSyncAnswerCard:
                        t_NullCmd
                {
                        stRSyncAnswerCard():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_R_SYNC_ANSWERCARD)
                        {
                                room_id_ = 0;
                                operator_id_ = 0;
                                status_ = 0;
                        }

                        DWORD room_id_;
                        DWORD operator_id_;
                        BYTE status_;
                };
                struct stRDelAnswerCard:
                        t_NullCmd
                {
                        stRDelAnswerCard():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_R_DEL_ANSWERCARD)
                        {
                                room_id_ = 0;
                        }

                        DWORD room_id_;
                };
                struct stRResAnswerCard:
                        t_NullCmd
                {
                        stRResAnswerCard():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_R_RES_ANSWERCARD)
                        {
                                room_id_ = 0;
                                operator_id_ = 0;
                                status_ = 0;
                        }

                        DWORD room_id_;
                        DWORD operator_id_;
                        BYTE status_;
                };
                struct stRSyncWBElement:
                        t_NullCmd
                {
                        stRSyncWBElement():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_R_SYNC_WB_ELEMENT)
                        {
                                room_id_ = 0;
                                page_ = 0;
                                element_id_ = 0;
                                size_ = 0;
                        }
                        DWORD room_id_;
                        WORD page_;
                        WORD element_id_;
                        WORD size_;
                        char element_[0];
                        DWORD getSize() 
                        {
                                return sizeof(*this)+size_*sizeof(element_[0]);
                        }
                };
                struct stRDelWBElement:
                        t_NullCmd
                {
                        stRDelWBElement():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_R_DEL_WB_ELEMENT)
                        {
                                room_id_ = 0;
                                page_ = 0;
                                element_id_ = 0;
                        }
                        DWORD room_id_;
                        WORD page_;
                        WORD element_id_;
                };
                struct stRResWBElement:
                        t_NullCmd
                {
                        stRResWBElement():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_R_RES_WB_ELEMENT)
                        {
                                room_id_ = 0;
                                page_ = 0;
                                element_id_ = 0;
                                size_ = 0;
                        }
                        DWORD room_id_;
                        WORD page_;
                        WORD element_id_;
                        WORD size_;
                        char element_[0];
                        DWORD getSize() 
                        {
                                return sizeof(*this)+size_*sizeof(element_[0]);
                        }
                };
                struct stRSyncClassInfo_old:
                        t_NullCmd
                {
                        stRSyncClassInfo_old():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_R_SYNC_CLASS_INFO_old)
                        {
                                room_id_ = 0;
                                class_teacher_id_ = 0;
                                bzero(class_teacher_account_, sizeof(class_teacher_account_));
                                bzero(class_teacher_nickname_, sizeof(class_teacher_nickname_));
                                class_start_time_ = 0;
                        }
                        uint32_t room_id_;
                        uint32_t class_teacher_id_;
                        char class_teacher_account_[MAX_ACCOUNT_SIZE+1];
                        char class_teacher_nickname_[MAX_NAME_SIZE+1];
                        uint32_t class_start_time_;
                };
                struct stRSyncQuestionList:
                        t_NullCmd
                {
                        stRSyncQuestionList():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_R_SYNC_QUESTION_LIST)
                        {
                                room_id_ = 0;
                                question_id_ = 0;
                                clear_flag_ = 0;
                                size_ = 0;
                        }

                        uint32_t getSize() const
                        {
                                return sizeof(*this) + size_*sizeof(json_[0]);
                        }

                        uint32_t room_id_;
                        uint32_t question_id_;
                        uint8_t clear_flag_;
                        uint16_t size_;
                        char json_[0];
                        // json_ = questions(array)
                        // question = question_id(uint) + question(string) + ask_user(uint) + ask_user_name(string) + ask_time(uint) + highlight(bool) + solve(bool) + solve_time(uint)
                };
                struct stRSyncQuestionLikeList:
                        t_NullCmd
                {
                        stRSyncQuestionLikeList():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_R_SYNC_QUESTION_LIKE_LIST)
                        {
                                room_id_ = 0;
                                question_id_ = 0;
                                clear_flag_ = 0;
                                size_ = 0;
                        }

                        uint32_t getSize() const
                        {
                                return sizeof(*this) + size_*sizeof(json_[0]);
                        }

                        uint32_t room_id_;
                        uint32_t question_id_;
                        uint8_t clear_flag_;
                        uint16_t size_;
                        char json_[0];
                        // json_ = likeusers(array)
                        // likeuser(uint)
                };
                struct stRAddQuestion:
                        t_NullCmd
                {
                        stRAddQuestion():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_R_ADD_QUESTION)
                        {
                                room_id_ = 0;
                        }

                        uint32_t getSize() const
                        {
                                return sizeof(*this) + size_*sizeof(json_[0]);
                        }

                        uint32_t room_id_;
                        uint16_t size_;
                        char json_[0];
                        // json_ = question_id(uint) + question(string) + ask_user(uint) + ask_user_name(string) + ask_time(uint)
                };
                struct stRDelQuestion:
                        t_NullCmd
                {
                        stRDelQuestion():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_R_DEL_QUESTION)
                        {
                                room_id_ = 0;
                                question_id_ = 0;
                        }

                        uint32_t room_id_;
                        uint32_t question_id_;
                };
                struct stRClearQuestion:
                        t_NullCmd
                {
                        stRClearQuestion():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_R_CLEAR_QUESTION)
                        {
                                room_id_ = 0;
                        }

                        uint32_t room_id_;
                };

                struct stRSyncQuestionLike:
                        t_NullCmd
                {
                        stRSyncQuestionLike():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_R_SYNC_QUESTION_LIKE)
                        {
                                room_id_ = 0;
                                question_id_ = 0;
                                user_id_ = 0;
                                like_ = 0;
                        }

                        uint32_t room_id_;
                        uint32_t question_id_;
                        uint32_t user_id_;
                        uint8_t like_;
                };
                struct stRSyncQuestionModify:
                        t_NullCmd
                {
                        stRSyncQuestionModify():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_R_SYNC_QUESTION_MODIFY)
                        {
                                room_id_ = 0;
                                question_id_ = 0;
                                modify_type_ = 0;
                                modify_time_ = 0;
                        }

                        uint32_t room_id_;
                        uint32_t question_id_;
                        uint8_t modify_type_;
                        uint32_t modify_time_;
                };
                struct stRAddUser:
                        t_NullCmd
                {
                        stRAddUser():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_R_ADD_USER)
                        {
                                room_id_ = 0;
                                user_id_ = 0;
                                user_type_ = 0;
                                enter_time_ = 0;
                                ip_ = 0;
                                mac_ =0;
                                session_id_ = 0;
                                net_ = 0;
                                show_identity_ = 0;
                                terminal_ = 0;
                                bzero(user_name_, sizeof(user_name_));
                                bzero(nick_name_, sizeof(nick_name_));
                        }

                        uint32_t room_id_;
                        uint32_t user_id_;
                        uint32_t user_type_;
                        uint32_t enter_time_;
                        uint32_t ip_;
                        uint64_t mac_;
                        uint16_t session_id_;
                        uint16_t net_;
                        uint8_t show_identity_;
                        uint8_t terminal_;
                        char user_name_[MAX_ACCOUNT_SIZE+1];
                        char nick_name_[MAX_NAME_SIZE+1];
                };
                struct stRSyncUserList:
                        t_NullCmd
                {
                        stRSyncUserList():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_R_SYNC_USER_LIST)
                        {
                                room_id_ = 0;
                                clear_flag_= 0;
                                size_ = 0;
                        }

                        uint32_t getSize() const
                        {
                                return sizeof(*this) + size_*sizeof(list_[0]);
                        }

                        uint32_t room_id_;
                        uint8_t clear_flag_;            // 1: clear 0: not
                        uint16_t size_;
                        struct {
                                uint32_t userid;
                                uint32_t usertype;
                                uint32_t entertime;
                                uint32_t ip;
                                uint64_t mac;
                                uint16_t sessionid;
                                uint16_t net;
                                uint8_t showidentity;
                                uint8_t terminal;
                                char username[MAX_ACCOUNT_SIZE+1];
                                char nickname[MAX_NAME_SIZE+1];
                        } list_[0];
                };
                struct stRReqRoom_old:
                        t_NullCmd
                {
                        stRReqRoom_old():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_R_REQ_ROOM_old)
                        {
                                room_id_ = 0;
                        }
                        
                        uint32_t room_id_;
                };
                struct stRResUserList:
                        t_NullCmd
                {
                        stRResUserList():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_R_RES_USER_LIST)
                        {
                                room_id_ = 0;
                                clear_flag_ = 0;
                                size_ = 0;
                        }

                        uint32_t getSize() const
                        {
                                return sizeof(*this) + size_*sizeof(list_[0]);
                        }

                        uint32_t room_id_;
                        uint8_t clear_flag_;            // 1: clear 0: not
                        uint16_t size_;
                        struct {
                                uint32_t userid;
                                uint32_t usertype;
                                uint32_t entertime;
                                uint32_t ip;
                                uint64_t mac;
                                uint16_t sessionid;
                                uint16_t net;
                                uint8_t showidentity;
                                uint8_t terminal;
                                char username[MAX_ACCOUNT_SIZE+1];
                                char nickname[MAX_NAME_SIZE+1];
                        } list_[0];
                };

                struct stRSyncRoomBaseInfo : t_NullCmd
                {
                        stRSyncRoomBaseInfo()
                                : t_NullCmd(CMDIN_ROOM, SCMDIN_R_SYNC_ROOM_BASE_INFO)
                        {
                                room_id_ = 0;
                                mode_ = eRoomMode_Dialog;
                                mic_duration_ = 600;
                                fidelity_ = 0;
                                functionality_ = 0;
                        }

                        uint32_t room_id_;
                        uint8_t mode_;
                        uint32_t mic_duration_;
                        uint8_t fidelity_;
                        uint32_t functionality_;
                };

                struct stRRoomBaseInfoReq : t_NullCmd
                {
                        stRRoomBaseInfoReq()
                                : t_NullCmd(CMDIN_ROOM, SCMDIN_R_ROOM_BASE_INFO_REQ)
                        {
                                room_id_ = 0;
                        }
                        
                        uint32_t room_id_;
                };

                struct stRRoomBaseInfoRet : t_NullCmd
                {
                        stRRoomBaseInfoRet()
                                : t_NullCmd(CMDIN_ROOM, SCMDIN_R_ROOM_BASE_INFO_RET)
                        {
                                room_id_ = 0;
                                mode_ = eRoomMode_Dialog;
                                mic_duration_ = 600;
                                fidelity_ = 0;
                                functionality_ = 0;
                        }

                        uint32_t room_id_;
                        uint8_t  mode_;
                        uint32_t mic_duration_;
                        uint8_t  fidelity_;
                        uint32_t functionality_;
                };

                struct stRRoomClassInfoReq_old : t_NullCmd
                {
                        stRRoomClassInfoReq_old()
                                : t_NullCmd(CMDIN_ROOM, SCMDIN_R_ROOM_CLASS_INFO_REQ_old)
                        {
                                room_id_ = 0;
                        }
                        
                        uint32_t room_id_;
                };

                struct stRRoomClassInfoRet_old : t_NullCmd
                {
                        stRRoomClassInfoRet_old()
                                : t_NullCmd(CMDIN_ROOM, SCMDIN_R_ROOM_CLASS_INFO_RET_old)
                        {
                                room_id_ = 0;
                                teacher_id_ = 0;
                                bzero(teacher_account_, sizeof(teacher_account_));
                                bzero(teacher_nickname_, sizeof(teacher_nickname_));
                                start_time_ = 0;
                        }

                        uint32_t room_id_;
                        uint32_t teacher_id_;
                        char teacher_account_[MAX_ACCOUNT_SIZE+1];
                        char teacher_nickname_[MAX_NAME_SIZE+1];
                        uint32_t start_time_;
                };

                struct stRRoomRestoreReq : t_NullCmd
                {
                        stRRoomRestoreReq()
                                : t_NullCmd(CMDIN_ROOM, SCMDIN_R_ROOM_RESTORE_REQ)
                        {
                                room_id_ = 0;
                        }

                        uint32_t room_id_;
                };
                
                struct stRRoomRestoreRet : t_NullCmd
                {
                        stRRoomRestoreRet()
                                : t_NullCmd(CMDIN_ROOM, SCMDIN_R_ROOM_RESTORE_RET)
                        {
                                room_id_ = 0;
                                ret_code_ = 0;
                        }

                        uint32_t room_id_;
                        uint8_t ret_code_;
                };

                struct stRSyncDalaba : t_NullCmd
                {
                        stRSyncDalaba()
                                : t_NullCmd(CMDIN_ROOM, SCMDIN_R_SYNC_DALABA)
                        {
                                room_id_ = 0;
                                size_ = 0;
                        }

                        uint32_t getSize() const
                        {
                                return sizeof(*this) + size_*sizeof(data_[0]);
                        }

                        uint32_t room_id_;
                        uint32_t size_;
                        char data_[0];
                };

                struct stRDalabaReq : t_NullCmd
                {
                        stRDalabaReq()
                                : t_NullCmd(CMDIN_ROOM, SCMDIN_R_DALABA_REQ)
                        {
                                room_id_ = 0;
                        }

                        uint32_t room_id_;
                };

                struct stRDalabaRet : t_NullCmd
                {
                        stRDalabaRet()
                                : t_NullCmd(CMDIN_ROOM, SCMDIN_R_DALABA_RET)
                        {
                                room_id_ = 0;
                                size_ = 0;
                        }

                        uint32_t getSize() const
                        {
                                return sizeof(*this) + size_*sizeof(data_[0]);
                        }

                        uint32_t room_id_;
                        uint32_t size_;
                        char data_[0];
                };

                struct stRAddUserNew :
                        t_NullCmd
                {
                        stRAddUserNew() :
                                t_NullCmd(CMDIN_ROOM, SCMDIN_R_ADD_USER_NEW)
                        {
                                data_size = 0;
                                room_id = 0;
                                user_id = 0;
                        }
                        uint32_t getSize() const
                        {
                                return sizeof(*this) + data_size * sizeof(data[0]);
                        }

                        uint32_t     room_id;
                        uint32_t     user_id;
                        uint32_t     data_size;
                        char           data[0];
                };

                struct stRResUserListNew :
                        t_NullCmd
                {
                        stRResUserListNew() :
                                t_NullCmd(CMDIN_ROOM, SCMDIN_R_RES_USER_LIST_NEW)
                        {
                                room_id_ = 0;
                                clear_flag_ = 0;
                                size_ = 0;
                        }

                        uint32_t getSize() const
                        {
                                return sizeof(*this) + size_*sizeof(data_[0]);
                        }

                        uint32_t room_id_;
                        uint8_t clear_flag_;            // 1: clear 0: not
                        uint16_t size_;
                        char data_[0];
                };

                struct stRSyncUserListNew :
                        t_NullCmd
                {
                        stRSyncUserListNew() :
                                t_NullCmd(CMDIN_ROOM, SCMDIN_R_SYNC_USER_LIST_NEW)
                        {
                                room_id_ = 0;
                                clear_flag_ = 0;
                                size_ = 0;
                        }

                        uint32_t getSize() const
                        {
                                return sizeof(*this) + size_*sizeof(data_[0]);
                        }

                        uint32_t room_id_;
                        uint8_t clear_flag_;            // 1: clear 0: not
                        uint16_t size_;
                        char data_[0];
                        /*
                        {
                            "user_id"  用户id
                            "user_name" 用户账号
                            "type" 用户类型
                            "nick_name" 昵称
                            "ip"  ip
                            "sid" session id
                            "show_id" show_identity_
                            "enter_time"  进房间时间
                            "net" 网络类型
                            "terminal"  终端类型
                            "unique_id"  用户本次登陆SID
                        }*/

                };

                struct stRSyncCourseInfo : t_NullCmd
                {
                        stRSyncCourseInfo() :
                                t_NullCmd(CMDIN_ROOM, SCMDIN_R_SYNC_COURSE_INFO)
                        {
                        }

                        uint32_t getSize() const
                        {
                                return sizeof(*this) + size_*sizeof(json_[0]);
                        }

                        uint32_t room_id_;
                        uint16_t size_;
                        char json_[0];
                        // json_ = teacher_info + course_info
                        // teacher_info = t_id(uint) + t_account(string) + t_nickname(string) + t_newclient(bool)
                        // course_info = c_starttime(uint)
                };

                struct stRCourseInfoReq : t_NullCmd
                {
                        stRCourseInfoReq()
                                : t_NullCmd(CMDIN_ROOM, SCMDIN_R_COURSE_INFO_REQ)
                        {
                                room_id_ = 0;
                        }
                        
                        uint32_t room_id_;
                };

                struct stRCourseInfoRet : t_NullCmd
                {
                        stRCourseInfoRet() :
                                t_NullCmd(CMDIN_ROOM, SCMDIN_R_COURSE_INFO_RET)
                        {
                        }

                        uint32_t getSize() const
                        {
                                return sizeof(*this) + size_*sizeof(json_[0]);
                        }

                        uint32_t room_id_;
                        uint16_t size_;
                        char json_[0];
                        // json_ = teacher_info + course_info
                        // teacher_info = t_id(uint) + t_account(string) + t_nickname(string) + t_newclient(bool)
                        // course_info = c_starttime(uint)
                };
        }; //namespace RoomCache
}; //namespace Cmd
#pragma pack() //pack(1)

#endif //ROOM_CACHE_COMMAND_H_
